/*
 *  ConvexParabola.cpp
 *  SoundController0002
 *
 *  Created by jiro on 10/06/28.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#include "ConvexParabola.h"
#include <cmath>

namespace sc 
{
	ConvexParabola::ConvexParabola( double startX, double startY, double endX, double endY )
		: Parabola( Line::Type_ConvexParabola, startX, startY, endX, endY )
	{
		if ( startY >= endY )
		{
			coefficientB = endX;
			coefficientC = endY;
			coefficientA = ( startY - coefficientC ) / std::pow( ( startX - coefficientB ), 2.0 );
		}
		else 
		{
			coefficientB = startX;
			coefficientC = startY;
			coefficientA = ( endY - coefficientC ) / std::pow( ( endX - coefficientB ), 2.0 );
		}
	}


	ConvexParabola::~ConvexParabola()
	{
	}

}